package club.banyuan.service;

import club.banyuan.bean.User;
import club.banyuan.dao.UserDao;
import club.banyuan.security.MyUserDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    private UserDao userDao;

    @Autowired
    public UserService(UserDao userDao) {
        this.userDao = userDao;
    }

    public User getUserByNameAndPassword(String username,String password){
        return userDao.getUserByUsernameAndPassword(username,password);
    }

    public User getUserByUserId(Integer userId){
        return  userDao.getUserByUserId(userId);
    }
    public User getUserByUserName(String username){
        return  userDao.getUserByUserName(username);
    }

    public Integer insertUser(User user){
        return  userDao.insertUser(user);
    }

}
